1. Field of the Invention
The present invention relates to computer image processing, and more particularly, to an image processing device which controls the order of rendering processing in response to attribute data for polygons constituting an object to be displayed, whereby rendering processing can be carried out reliably and efficiently, and to a method for same, and a recording medium whereon image processing programs for implementing this method are stored.
2. Description of the Related Art
Image processing technology based on computers is used in simulation devices, game devices, and the like. Usually, data for polygons to be drawn on a screen is determined from image data generated by a sequence program for the simulation or game, colour data is determined for each pixel in these polygons, and this colour data is stored in a frame buffer memory corresponding to each pixel of the screen. An image is then displayed on a display device, such as a CRT, in accordance with the colour data in the frame buffer memory.
The process of determining the aforementioned polygon data is usually carried out by a geometry processing section, whilst the process of determining colour data for each pixel from the polygon data is carried out by a rendering section. The polygon data produced by the geometry processing section generally comprises vertex data. The colour data for pixels in a polygon is determined by interpolation of the parameter values contained in the vertex data.
However, in some cases, a frame may contain a plurality of polygons which overlap with each other, and in this event, only the portions of polygons which are foremost in the screen are displayed, whilst the portions of polygons which are covered by another polygon are not displayed. Therefore, conventionally, a Z-value buffer memory corresponding to the pixels in each frame is provided, and when the colour data for a pixel to be displayed is written into the frame buffer memory, the Z-value for that pixel is written into a region of the Z-value buffer memory corresponding to the pixel. The operation of deciding whether or not a pixel in a polygon processed subsequently is positioned in front of a pixel already written to the memory is carried out by comparing their respective Z values. Therefore, when the Z value for a pixel is greater than the Z value in the Z value buffer, its colour data is not produced and written to the frame buffer, since this pixel will not be displayed. In this way, the efficiency of the rendering process is improved.
The Z-value described above means depth value indicating a depth in a display screen. For the convenience, the depth value is referred to Z-value hereinafter.
Alternatively, as a further algorithm, the colour data may always be written to the frame buffer starting from the polygon which is foremost in the frame. By adopting this method, it is possible to avoid making purposeless calculations when determining the colour data.
However, as well as opaque polygons, there also exist semi-transparent polygons. In order to make the generated images more realistic, it is necessary to provide processing for blending the colour of a semi-transparent polygon with the colour of a different polygon positioned behind it. In this case, when a pixel under processing is semi-transparent, a suitable blending process is carried out with reference to the frame buffer memory.
However, if the colour data for a semi-transparent pixel positioned to the front of the screen is written to the frame buffer memory first, and a pixel in a further polygon positioned behind this pixel is rendered subsequently, it will not be possible to judge whether or not a blending process is necessary. Therefore, in the aforementioned algorithm, colour data for pixels in the further polygon positioned to the rear will not be accounted for in the colour data for the pixels in the semi-transparent polygon. This cannot be regarded as a suitable rendering process.
In order to resolve this point, it is possible, for example, firstly to sort the polygons to be displayed on the screen by means of their Z values, and then to render the polygons in sequence, starting from the polygon positioned furthest to the rear. In this case, since a polygon positioned towards the front of the screen will always be rendered subsequently, rendering for semi-transparent polygons can be carried out reliably. However, using this algorithm, it is necessary to conduct a rendering process for all of the polygons, which means that the colour data for polygons positioned towards the front of the screen will usually be written over previous data, and therefore the efficiency of the rendering process will be poor. A time-consuming rendering process is undesirable, since it places limitations on the number of objects that can be displayed in a screen, and on other special processing.
Furthermore, appropriate special rendering processes may be required not only due to the relationship between opaque polygons and semi-transparent polygons, but also, for instance, the relationship between opaque polygons containing transparent pixels and other polygons, or the relationship between background polygons and polygons located in the far distance from the viewpoint displayed on the screen. In these cases also, the priority of the rendering operations must be taken into account in order to achieve suitable processing and high processing efficiency.
Therefore, taking the aforementioned problems of the related art into consideration, the purpose of the present invention is to provide an image processing device, whereby more realistic images can be generated and the efficiency of rendering processing can be improved, and a method for same and a storage medium whereon image processing programs for implementing this method are stored.
The purpose of the present invention is also to provide an image processing device, whereby rendering of semi-transparent polygons can be carried out appropriately and a high processing efficiency can be achieved, and a method for same and a storage medium whereon image processing programs for implementing this method are stored.
The purpose of the present invention is also to provide an image processing device, whereby rendering of polygons containing transparent portions can be carried out with good efficiency, and a method for same and a storage medium whereon image processing programs for implementing this method are stored.
The purpose of the present invention is also to provide an image processing device, whereby rendering of polygons positioned in the far distance can be carried out appropriately and high processing efficiency can be achieved, and a method for same and a storage medium whereon image processing programs for implementing this method are stored.